package com.petecat.interchan.base.warning.empl.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.petecat.interchan.base.warning.empl.entity.BsWarningEmpl;
import com.petecat.interchan.core.mapper.BaseMapper;
import com.petecat.interchan.protocol.base.config.dto.DelEmplDTO;
import com.petecat.interchan.protocol.base.empl.dto.BsWarningEmplQryDTO;
import com.petecat.interchan.protocol.base.empl.vo.BsWarningEmplTreeVO;

@Mapper
@Repository
public interface IWarningEmplMapper extends BaseMapper<BsWarningEmpl, String>{
	
	/**
	 * TREE查询预警人员
	 * @param bsWarning
	 * @return
	 */
	List<BsWarningEmplTreeVO> queryWarningRuleTree(BsWarningEmplQryDTO bsWarning);
	
	/**
	 * 通过规则ID获取预警人员
	 * @param ruleId
	 * @return
	 */
	List<BsWarningEmpl> queryEmplListByRuleId(@Param("id") String ruleId);
	
	/**
	 * 通过RuleId和UserId删除多个预警人员 
	 * @param delEmplDTO
	 */
	void delEmplsByUserIdAndRuleId(@Param("delEmplDTO") List<DelEmplDTO> delEmplDTO);
	
	/**
	 * 删除所有预警人员
	 * @param id
	 */
	void delEmplsByRuleId(@Param("ruleId") String id);
	
	/**
	 * 删除规则对应的表中残余多余预警人员
	 * @param delRules
	 */
	void delEmplsByRuleIds(@Param("ruleIds") String[] delRules);

}
